import { S } from '../../s';
import { IPSAppWF } from './ipsapp-wf';
import { IPSAppWFDE } from './ipsapp-wfde';
import { IPSAppWFVer } from './ipsapp-wfver';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppWFImpl extends PSModelObjectImpl implements IPSAppWF {
  get codeName(): string {
    return this.M.codeName;
  }

  protected psappwfdes: IPSAppWFDE[];
  getPSAppWFDEs(): IPSAppWFDE[] | null {
    return (
      this.psappwfdes ||
      (this.psappwfdes = this.fillChildListModel(
        this.M.getPSAppWFDEs,
        S._3a3,
      ) as IPSAppWFDE[])
    );
  }

  findPSAppWFDE(objKey: any): IPSAppWFDE | null {
    return this.getPSModel5(S._3a3, this.getPSAppWFDEs(), objKey) as IPSAppWFDE;
  }

  protected psappwfvers: IPSAppWFVer[];
  getPSAppWFVers(): IPSAppWFVer[] | null {
    return (
      this.psappwfvers ||
      (this.psappwfvers = this.fillChildListModel(
        this.M.getPSAppWFVers,
        S._90,
      ) as IPSAppWFVer[])
    );
  }

  findPSAppWFVer(objKey: any): IPSAppWFVer | null {
    return this.getPSModel5(
      S._90,
      this.getPSAppWFVers(),
      objKey,
    ) as IPSAppWFVer;
  }

  hasPSAppWFVer(): boolean {
    return this.M.hasPSAppWFVer;
  }
  get cls(): string {
    return 'PSAppWFImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._8f) return true;
    return super.instanceof(cls);
  }
}
